-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add quiver trace type for vector field visualization #7584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
dfd3c81 to
9463b3f
Compare
|
Hello, I am new to this project and attempting to contribute my first PR. Unfortunately, I am struggling to get the build to pass. Specifically, the I tried running But still encountering the issue. Any insight would be greatly appreciated. Thank you! Edit: tagging a few recent commiters for visibility, thanks so much! (cc @camdecoster @alexshoe @emilykl) |
|
Hi @degzhaus, thank you for working on this contribution! As it stands currently, the devtools dashboard needs to be running in order for You can also download |
b07de7b to
a32678d
Compare
Thank you so much, @emilykl! That was very helpful and unblocked me.
Edit: @emilykl i figured it out! Pardon my flailing at last night. So exciting! I have a couple of tests to add and this will be ready for review. Thanks again for your insights and help! |
64cf31d to
02c37f5
Compare
|
@degzhaus Great news, glad you're unblocked! Thank you for your work on this. Quiver is a plot type we've gotten a lot of requests for. A few high-level comments on the API:
|
Amazing, thank you so much for taking a look and providing great guidance, Emily! Looking forward to spinning a cycle on this feedback. |
|
@degzhaus One more comment — it would be great to include colorscale attributes in |
|
Great news @degzhaus! I've started looking at the code and I'll get back to you soon with another round of review. One quick question: your PR description refers to some Jasmine test files and image mocks which I don't see in the diff, did you maybe forget to push some files? |
4a9ff5e to
12a46e6
Compare
Amazing, thank you so much @emilykl ! I did indeed forget to push the tests, which i have done now here: One thing I'm spinning my wheels on now is the image generation. I generated them locally here: But as you can see here, they are failing in ci: One notable strangeness is that they look good in my commit, but look strange in the ci artifacts. One example: Thanks again for all your help with this PR! |
Okay, I see what is happening now, @emilykl ! I was looking at the diff, not the raw image that CI generates. Here is an example: CI generates the following image for And corresponding diff for the same image: So, maybe something is different with my local versioning for dependencies? My only fear is that if I swap in the raw images that CI generates, that it is actually wrong and/or could break or flake in the future. Hmm 🤔 Thanks again for everything, and I hope you have a splendid day! |
9287e5c to
7d2175e
Compare
feea298 to
f3ae9e2
Compare
@emilykl I got it 🥳 I hadn't worked with the So excited! I will clean up some commits in the morning. Thanks again! |






Overview
This PR adds a new
scatterquivertrace type to Plotly.js for visualizing vector fields. The implementation includes:scatterquiverfor quiver/vector field plotsFeatures
Screenshots
Examples taken from:
https://plotly.com/python/quiver-plots/
Here is a gist of the 2 plots used in the examples:
https://gist.github.com/degzhaus/2fb3c08cbc228682125f94bce52ba7d1
Basic Quiver Plot (
0-quiver-meshgrid.html)Adding

colorscale: [[0, 'blue'], [1, 'blue']],tovar data = [{:Quiver Plot with Points (
1-quiver-gradient.html)Adding
colorscale: 'Viridis',tovar data = [:Testing
Files Added/Modified
src/traces/scatterquiver/- Complete trace implementationlib/index.js&lib/index-strict.js- Build integrationtest/jasmine/tests/scatterquiver_test.js- Unit teststest/image/mocks/scatterquiver_*.json- Mock datatest/jasmine/assets/mock_lists.js- Test integrationDraft Log
draftlogs/7584_add.md- Changelog entryThis addresses the need for vector field visualization in Plotly.js, similar to matplotlib's quiver plots.